Method of detecting blocking artefacts

ABSTRACT

The invention relates to a method of detecting blocking artefacts within a sequence of digital images. The method comprises a step of high-pass filtering ( 110 ) a portion of a digital image, intended to supply at least one card of discontinuity pixels. It also comprises a step of detecting ( 120 ) blocking artefacts from the at least one card of discontinuity pixels. Finally, it comprises a step of searching ( 130 ), HPF within the portion of the digital image, a set of grid rows, a grid row having a density of discontinuity pixels which is substantially higher than that of its neighboring rows. Such a method of detecting blocking artefacts is particularly efficient and allows, for example, a better correction of blocking artefacts in the grid rows.

The invention relates to a method of processing data corresponding to pixels of a sequence of digital images so as to detect a grid corresponding to blocking artefacts, said method comprising a step of high-pass filtering a portion of a digital image, intended to supply at least one card of discontinuity pixels, and a step of detecting blocking artefacts from the at least one card of discontinuity pixels.

The invention also relates to a television receiver comprising a processing device implementing the data processing method according to the invention.

It notably finds its application in the detection of blocking artefacts within a digital image which has been previously encoded and then decoded in accordance with a block-based encoding technique, for example, the MPEG standard (“Motion Pictures Expert Group”), and in the correction of data comprised in these blocks in order to attenuate the visual artefacts caused by the block-based encoding technique.

The blocking artefacts constitute a crucial problem for the block-based encoding techniques using a discrete transform of the discrete cosine transform DCT type. They appear in the form of block mosaics which are sometimes extremely visible in the decoded image sequences. These artefacts are due to a strong quantization subsequent to the discrete transform, which strong quantization causes strong discontinuities to appear at the borders of the encoding blocks.

International patent application WO 01/20912 (docket: PHF99579) describes a method with which a grid corresponding to blocking artefacts within a decoded digital image can be detected and localized. This method authorizes the detection of three regular grid sizes of 8×8, 10×8 and 12×8 pixels, which grid sizes result from principal formats of images used for broadcasting televised digital programs. The grid 8×8 corresponds to an image sequence encoded in a format of 576 rows of 720 pixels, the grid 10-11-11×8, approximate to a grid of 10×8, corresponds to an encoding in a 576×540 format, referred to as encoding format ¾, and a grid 12×8 corresponds to an encoding in a 576×480 format, referred to as encoding format ⅔. The size of the grid is obtained by searching the most frequent distances between the blocking artefacts. The offset of the grid with respect to the origin (0,0) of the image is obtained by searching, among all possible offsets, the offset which corresponds to the presence of the largest number of blocking artefacts.

It is an object of the present invention to propose a data processing method which is more efficient.

The prior-art method is based on the search and the detection of blocking artefacts which are regularly spaced apart. Thus it searches only one size of the grid within an image and one offset of the grid with respect to the origin of said image. However, the grid may be distorted within the image because of a resampling of the image. This distortion may sometimes be known in advance, as in the case of the ¾ encoding format, where the width of the grid varies in accordance with the 10-11-11 pattern. However, this variation is mostly arbitrary because it originates, for example, from a rate transcoding, an image format conversion in a 16/9 television receiver, from a 4/3 format into, for example, a 16/9 format, a zoom in a portion of the image, an A/D conversion, or even a combination of these different conversions. In this case, the prior art method retains the grid having the most frequent size and position and applies a post-processing step based on this grid, with a risk of a partial or even inefficient correction.

To cope with these problems, the data processing method according to the invention is characterized in that it comprises a step of searching, within the portion of the image, a set of grid rows, a grid row having a density of blocking artefacts which is substantially larger than that of its neighboring rows.

The processing method according to the invention is based on an analysis and partitioning of the blocking artefacts per row of an image and not on a search of the periodicity of the distances between the blocking artefacts, as in the prior-art technique. The result is a set of grid rows, in which the distance between the grid rows may be variable due to a resampling of the image, and not a grid having a mesh of fixed size. The processing method according to the invention thus provides the possibility of processing resampled images without a priori knowing the possible resampling operations.

Moreover, the risk of false detections is reduced as the selection of the blocking artefacts is made row by row, in contrast to the prior-art method in which the selection is made segment by segment, which considerably improves the efficiency of the method.

These and other aspects of the invention are apparent from and will be elucidated, by way of non-limitative example, with reference to the embodiment(s) described hereinafter.

In the drawings:

FIG. 1 is a diagram showing the data processing method according to the invention;

FIG. 2 illustrates two artefact profiles p1 and p2 which are principally encountered in images encoded in accordance with a block-based encoding technique, represented in the spatial domain and the frequential domain;

FIG. 3 describes a method of correcting blocking artefacts; and

FIG. 4 describes the principle of correcting a blocking artefact of the type p2.

The invention relates to a method of processing a sequence of digital images encoded and decoded in accordance with a block-based encoding technique. In our example, the encoding technique used is the MPEG standard based on the discrete cosine transform DCT, but may alternatively be any other equivalent standard, such as, for example, the H.263 or H.26L standard. It should be noted that this method may also be applied to a fixed image, encoded, for example, in accordance with the JPEG standard. The processing method first relates to the detection of blocking artefacts due to these block-based encoding techniques and subsequently to the ensuing application such as, for example, post-processing techniques or image quality measurements.

FIG. 1 shows diagrammatically the processing method according to the invention. Such a method first comprises a step of high-pass filtering HPF (110) a portion of a digital image. This portion is, for example, one of the two fields of a frame if the image is constituted by two interlaced frames. In the preferred embodiment, the high-pass filtering step is a gradient filtering step using the filter hp1=[1, −1, −4, 8, −4, −1, 1]. This filter is applied horizontally and vertically, row LGN by row, to pixels of luminance Y(m,n) of the field FLD of a digital image of the sequence, where m and n are integers between 1 and M and between 1 and N, respectively, corresponding to the position of the pixel in the field in accordance with a vertical and horizontal axis, respectively, (M=288 and N=720 in, for example, a 576×720 encoding format).

The result of this filtering operation is preferably constituted by two cards of discontinuity pixels, a horizontal card Eh and a vertical card Ev. As the majority of resampling operations is performed in the horizontal direction, the horizontal card Eh showing the vertical discontinuities may suffice in a first approximation. However, the processing method according to the invention will have an optimal efficiency when it is based on processing the two cards Eh and Ev of the discontinuity pixels.

Other gradient filters are possible such as, for example, the high-pass filter for the wavelet transform hp2=[0.045635882765054703, −0.028771763667464256, −0.2956358790397644, 0.5574351615905762, −0.2956358790397644, −0.028771763667464256, 0.045635882765054703] proposed by Antonini et al. in the article “Image Coding Using Wavelet Transform” IEEE Trans. Image Processing, vol. 1, no. 2, pp. 205-220, April 1992. Moreover, the high-pass filter hp1 can be implemented in a particularly simple way and yields results close to those of the filter hp2.

The method comprises a step of determining discontinuities corresponding to blocking artefacts BAD (120). Indeed, the discontinuities may correspond to blocking artefacts as well as to natural contours. The selection of pixels corresponding to blocking artefacts is performed as a function of the values of the filtered coefficients Yf corresponding to the discontinuity pixels, resulting in two binary cards of the probable position of the elementary blocking artefacts. FIG. 2 illustrates two artefact profiles p1 and p2 which are principally encountered in the images encoded in accordance with a block encoding technique, in the spatial domain as well as their representation in the frequency domain after filtering with the filter hp1 or hp2. The first profile p1 corresponds to a standard blocking artefact while the second profile p2 corresponds to a blocking artefact which is present in an image that has been submitted to a resampling operation or an equivalent processing operation. In the spatial domain, the first profile p1 is a simple step of a staircase, while the second profile p2 is a double step of a staircase. In the frequency domain, the first profile p1 is expressed by a peak whereas the second profile p2 is expressed by a double peak.

In the preferred embodiment, the step of determining discontinuities corresponding to blocking artefacts comprises a sub-step of detecting natural contours and non-visible artefacts. To this end, a coefficient value filtered horizontally Yfh(m,n) and/or vertically Yfv(m,n) must lie between two thresholds so as to be able to correspond to a blocking artefact. The first threshold S1 corresponds to a visibility threshold, whereas the second threshold corresponds to the limit from which the pixel of position (m,n) corresponds to a natural contour. The condition is preferably taken for the absolute value of coefficients filtered as follows: S 1<|Yfh(m,n)|<S 2 and S 1<|Yfv(m,n)|<S 2 As an alternative, the following condition is used: S′1<|Yfh(m,n)|² +|Yfv(m,n)|² <S′2 in which S′1 and S′2 have the same function as S1 and S2. The threshold values depend on the filter used. For the filter hp2, we take, for example, S′1=0.6 and S′2=400, S1=0.5 and S2=20. It may be particularly advantageous, in the case of MPEG-4 applications, where access to video data streams and thus to field quantization steps is possible, to vary the thresholds S1 to S2 as a function of said quantization step so as to further improve the efficiency of the processing method. For example, the threshold values are a linear function of the quantization step.

The step of determining discontinuities corresponding to blocking artefacts also comprises a sub-step of detecting blocking artefacts. A vertical artefact corresponding to the profile p1 is detected by scanning the vertical card Ev in accordance with a horizontal direction corresponding to the rbw m if the following condition is satisfied: Yfv(m,n)|>|Yfv(m,n+k)| with k=−2, −1, +1, +2.

The border of the block is localized between the pixel of position (m,n) and that of the position (m, n+1) if |Y(m,n)−Y(m,n−1)|<|Y(m,n)−Y(m,n+1)| and between the pixel of position (m,n−1) and that of position (m,n) in the opposite case.

An artefact corresponding to profile p2 is detected if the following cumulative conditions are satisfied: f 1·|Yfv(m,n)|<Yfv(m,n−1)|+Yfv(m,n+1)|) |Yfv(m,n−1)|>f 2·|Yfv(m,n−2)| |Yfv(m,n+1)|>f 2·|Yfv(m,n+2)| with f1=6 and f2=2 in the preferred embodiment.

The border of the block is localized between the pixel of position (m,n−1) and that of position (m,n). The detection of a horizontal artefact corresponding to each profile p1 and p2 is effected in a similar manner by scanning the horizontal card Eh comprising the coefficients Yfh(m,n) filtered in a vertical direction corresponding to the column n.

In another embodiment which can easily be carried out, the high-pass filtering step is based on a gradient filtering operation using the filter hp3=[−1,1]. This type of filter provides the possibility of easily detecting blocking artefacts of the standard type corresponding to the profile p1. The step of determining discontinuities corresponding to blocking artefacts comprises a sub-step of detecting natural contours such as a natural contour which is detected when: |Yfh(m,n)|<Sh and |Yfv(m,n)|<Sv with Sh=35 and Sv=50 for luminance values Y(m,n) varying between 0 and 255 in our example.

The step of determining discontinuities corresponding to blocking artefacts comprises a sub-step, effected on the filtered values Yfh and/or Yfv of pixels with the exception of natural contours, of detecting a blocking artefact which is detected when: $\quad\left\{ \begin{matrix} {{{{Yfh}\left\lbrack {i,j} \right\rbrack}} > {{{{Yfh}\left\lbrack {i,{j - 1}} \right\rbrack}} + \frac{\overset{\_}{Yfh}}{2}}} \\ {{{{Yfh}\left\lbrack {i,j} \right\rbrack}} > {{{{Yfh}\left\lbrack {i,{j + 1}} \right\rbrack}} + \frac{\overset{\_}{Yfh}}{2}}} \end{matrix} \right.$ |{overscore (Yfh)}| being the average of the absolute value of Yfh in a field.

The processing method also comprises a step of searching (130) within the current field, rows of pixels having a high density of segments of elementary blocking artefacts as compared with neighboring rows.

This search step first comprises a selection sub-step SEL (131) intended to select segments in a horizontal or vertical row of the card of discontinuity pixels, which segments comprise a number of consecutive blocking artefacts Which is higher than a predetermined threshold S0. Indeed, the isolated discontinuities generally correspond to supplementary noise, while the blocking artefacts which are due to a coarse quantization of the DCT coefficients generally cause linear faults to appear along the encoding blocks. The value S0 of the predetermined threshold must not be too low so as not to favor the false detection. It must neither be too high so as not to constrain the selection too much by reducing the number of segments of detected elementary blocking artefacts. In practice, the value S0 is fixed at 3 for a field of 288 rows of 720 pixels.

The searching step also comprises a sub-step of computing CAL (132) a level Nb_(i) of the blocking artefacts per row L_(i), i being an integer corresponding to the number of the row in the field. In the preferred embodiment, the level of the blocking artefacts is obtained by counting the number of pixels associated with the segments of elementary artefacts present in a row. As an alternative, the level of blocking artefacts may be obtained by summing the values of the filtered coefficients Yf of the discontinuity pixels corresponding to the elementary artefacts of the selected segments in a row.

The searching step finally comprises a sub-step of determining GLD (133) the grid row, a row being detected by comparison with a set of neighboring rows.

In the case of the first profile p1, a row L_(i) is determined as being a row of the grid based on a comparison of block artifact levels of a current row L_(i), of the row which precedes immediately L_(i−1), and of the row which follows immediately L_(i+1), if: Nb _(i)>α(Nb _(i−1) +Nb _(i) +Nb _(i+1)) and Nb _(i) >T 1.N wherein α is a coefficient which is equal, for example, to ⅔ for the detection of vertical rows, and to ⅗ for the detection of horizontal rows; T1 is a minimum percentage of artefacts in a row with which this row can be considered to belong to the grid, which percentage is taken to be equal to 10% in our example, and wherein N is the number of pixels per row, i.e. 720 in our example, so that the product T1.N is equal to 72.

In the case of the second profile p2, a row L; is determined as being a row of the grid based on a comparison of blocking artefact levels of a current row L_(i) and of the rows which precede immediately L_(i−1) and L_(i−2) and follow immediately L_(i+1) and L_(i+2) if Nb _(i)>β(Nb _(i−2) +Nb _(i−1) +Nb _(i) +Nb _(i+1) +Nb _(i+2)) and Nb _(i) >T 2.N wherein β is a coefficient which is equal to ⅔ in our example; T2 is a minimum-percentage of artefacts in a row, which is equal to 5% for the detection of vertical rows and 20% for the detection of horizontal rows. The condition Nb_(i)>T2.N provides the possibility of controlling the reliability of the system. By increasing the value of T2, the risk of false detections is reduced.

The steps of the processing method described above are applied to the set of rows in a field (150). Subsequently, the processing method comprises a step of validation GV (140) intended to determine whether a number of rows of the grid is present within the field. This step takes place once the whole field has been investigated. The validation step ensures that no false detections of rows of the grid take place, notably for image sequences which have not been encoded and then decoded in accordance with a block-based encoding technique or which have been encoded in accordance with these techniques at high bit rates. Indeed, a false detection may take place if the number of rows of the grid found in the same field is very low. Thus, the validation step consists of comparing the total number Ntot of grid rows found in the field, this number Ntot being equal to the sum of the number of rows of the horizontal grid and the number of rows of the vertical grid with a predetermined threshold Stot. In our example, the number Ntot only totalizes rows of the grids corresponding to the profile p1; it is, however, possible to also take the rows of the grid corresponding to profile p2 into account by modifying the value of the threshold Stot. If the total number Ntot is higher than the threshold Stot, a grid is present in a field. The predetermined threshold Stot is a function of the horizontal and vertical dimensions H and V of the field by taking as a hypothesis that a maximum size of the grid is 16×16 pixels and at least a fraction, taken to be equal to one third in our example, of the grids must be detected for the detection to be valid, in other words: Stot=(H+V)/(3×16).

A first application of the data processing method according to the invention is constituted by post-processing images, intended to correct the blocking artefacts which are present in the rows of the grid. The correction depends on the profile of the detected blocking artefact. If the blocking artefact corresponds to profile pI, the correction described with reference to FIG. 3 is applied. The method of correcting blocking artefacts comprises the steps of:

-   -   computing a first discrete cosine transform DCT1 (31) of a first         set of N data u, situated at the left or above the border of the         block;     -   computing a second cosine discrete transform DCT1 (32) of a         second set of N data v, situated at the right or below the         border of the block and adjacent to the first set;     -   computing a global discrete cosine transform DCT2 (33) of a set         of 2N data w corresponding to the concatenation CON (30) of the         first and second sets and providing a set of transformed data W;     -   determining PRED (34) a predicted maximum frequency kwpred from         the transformed data U and V obtained from the first (31) and         second (32) transform DCT1, computed in the following manner:         kwpred=2.max(ku max,kv max)+2         with         ku max=max(ke{0, . . . ,N−1}/abs(U(k))>T),         kv max=max(ke{0, . . . ,N−1}/abs(V(k))>T),         where T is a threshold which is different from zero;     -   correcting ZER (35) by setting the odd transformed data W from         the global discrete transform to zero, whose frequency is higher         than the predicted maximum frequency, yielding corrected data         W′;     -   computing an inverse discrete cosine transform IDCT2 (36) of         corrected data, yielding filtered data w′ which are subsequently         intended to be displayed on the screen.

If the blocking artefact corresponds to the profile p2, the correction must be modified considerably. Indeed, the position of the border of the block must be given more precisely because of the double step of the staircase corresponding to the profile p2, as illustrated in FIG. 4. To this end, the correction method preliminarily comprises a step of readjusting the luminance value of the intermediate pixel p(n) intended to give said luminance value the luminance value of the pixel which is situated directly on its right p(n+1). The previously described steps are then applied, in which the border of the block is present at the left of the intermediate pixel, which then forms part of the segment v. It is alternatively possible to choose the luminance value of the intermediate pixel to correspond to that of the pixel on the left, or to that of the pixel having the nearest luminance value. In both cases, the positioning of the segments u and v is adapted accordingly so as to apply the correction step.

A second application of the data processing method according to the invention is constituted by a device for measuring the block level of the field in order to determine the quality of the images. The result of this measurement, also referred to as metric measurement, is computed, for example, field by field by adding the levels of the blocking artefacts Nb_(i) of the different rows of the grid.

It is possible to implement the processing method according to the invention by means of a television receiver circuit, said circuit being suitably programmed. A computer program stored in a programming memory may cause the circuit to perform the different operations described hereinbefore with reference to FIG. 1. The computer program may also be loaded into the programming memory for reading a data carrier such as, for example, a disc comprising said program. The reading operation may also be performed by means of a communication network such as, for example, the Internet. In this case, the service provider will put the computer program in the form of a downloadable signal at the disposal of those interested.

Any reference sign between parentheses in the present text should not be construed as being limitative. Use of the verb “comprise” and its conjugations does not exclude the presence of elements or steps other than those stated in the claims. Use of the article “a” or “an” preceding an element or step does not exclude the presence of a plurality of such elements or steps. 

1. A method of processing data corresponding to pixels of a sequence of digital images so as to detect a grid corresponding to blocking artefacts, said method comprising a step of high-pass filtering (110) a portion of a digital image, intended to supply at least one card of discontinuity pixels, and a step of detecting (120) blocking artefacts from the at least one card of discontinuity pixels, the method being characterized in that it comprises a step of searching (130), within said portion, a set of grid rows, a grid row having a density of blocking artefacts which is substantially larger than that of its neighboring rows.
 2. A data processing method as claimed in claim 1, wherein the searching step comprises the sub-steps of: selecting (131), in a row of the portion of the image, segments comprising a number of consecutive blocking artefacts which is larger than a predetermined first threshold; computing (132) a blocking artefact level per row on the basis of values of pixels of the selected segments; determining (133) a grid row on the basis of a comparison of the blocking artefact levels of a current row and a set of neighboring rows.
 3. A data processing method as claimed in claim 2, comprising a step of measuring the image quality, intended to add the blocking artifact levels of the different rows of the grid for the portion of the image.
 4. A data processing method as claimed in claim 1, also comprising a step of validation (140), intended to determine whether a grid is present within the portion of the digital image if the number of grid rows found in said portion is higher than a second predetermined threshold.
 5. A data processing method as claimed in claim 1, wherein the high-pass filtering step (110) is intended to supply two cards of discontinuity pixels, one horizontal card and one vertical card.
 6. A data processing method as claimed in claim 1, wherein the step of detecting blocking artefacts is intended to detect a first type (p1) of blocking artefacts and a second type (p2) of blocking artefacts from the at least one card of discontinuity pixels.
 7. A data processing method as claimed in claim 6, comprising a step of correcting the blocking artefacts situated in the grid rows in accordance with their type (p1, p2).
 8. A television receiver comprising a processing device using the data processing method as claimed in claim 7, suitable for detecting the grid rows within a sequence of digital images and for correcting the blocking artefacts situated in said rows, with a view to displaying corrected digital images on a screen of said receiver.
 9. A computer program product comprising a set of instructions which, when loaded into a circuit, cause said circuit to perform the method of processing digital images as claimed in claim
 1. 